class Program
{
    static void Main(string[] args)
    {
        int n = 0;
        for (int i = 1; i <= 4; i++)
        {
            int bw = i;
            for (int j = 1; j <= 4; j++)
            {
                int sw = j;
                if (bw != sw)
                {
                    for (int k = 1; k <= 4; k++)
                    {
                        int gw = k;
                        if (gw != sw && gw != bw)
                        {
                            n++;
                            Console.Write("{0}{1}{2}", bw, sw, gw + "     ");
                        }
                    }
                }
            }
        }
        Console.WriteLine("共有" + n + "个");
        Console.ReadLine();
    }
}